package org.lex.dbq.model.jdbc.meta;

import java.util.Comparator;

public class ColumnVo {
	public static final Comparator<ColumnVo> ORDINAL_COMPARATOR = new Comparator<ColumnVo>() {
		@Override
		public int compare(ColumnVo o1, ColumnVo o2) {
			return o1.ordinalPosition - o2.ordinalPosition;
		}
	};

	public static final String[] COLUMN_NAMES = { "Name", "Type", "Nullable", "Default", "Comments" };

	public String name = "";
	public String type = "";
	public boolean nullable;
	public String defaultValue = "";
	public String comment = "";

	public int ordinalPosition;

	public String getLabel(int col) {
		switch (col) {
		case 0:
			return name;
		case 1:
			return type;
		case 2:
			return Boolean.toString(nullable);
		case 3:
			return defaultValue;
		case 4:
			return comment;
		default:
			return "";
		}
	}
}
